/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JPanelSVM.java
 *
 * Created on 08/11/2010, 15:44:40
 */

package modulosvm;

import java.awt.TextField;

/**
 *
 * @author Adriano
 */
public class JPanelSVM extends javax.swing.JPanel {

    /** Creates new form JPanelSVM */
    public JPanelSVM() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabelC = new javax.swing.JLabel();
        jTextFieldC = new javax.swing.JTextField();
        jButtonConcluir = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jTextFieldEps = new javax.swing.JTextField();
        jTextFieldTolerance = new javax.swing.JTextField();
        jTextFieldSigma = new javax.swing.JTextField();
        jCheckBoxDadosEsparcos = new javax.swing.JCheckBox();
        jCheckBoxKernalLinear = new javax.swing.JCheckBox();
        jCheckBoxDadosBinarios = new javax.swing.JCheckBox();

        jLabelC.setText("C:");

        jTextFieldC.setText("0.005");

        jButtonConcluir.setText("Concluir");
        jButtonConcluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonConcluirActionPerformed(evt);
            }
        });

        jLabel1.setText("eps:");

        jLabel2.setText("tolerance:");

        jLabel3.setText("two sigma squared:");

        jTextFieldEps.setText("0.001");

        jTextFieldTolerance.setText("0.001");

        jTextFieldSigma.setText("2");

        jCheckBoxDadosEsparcos.setText("Dados Esparços");

        jCheckBoxKernalLinear.setText("Kernel Linear");

        jCheckBoxDadosBinarios.setText("Dados Binarios");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButtonConcluir)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2)
                            .addComponent(jLabelC)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTextFieldSigma)
                            .addComponent(jTextFieldTolerance)
                            .addComponent(jTextFieldEps)
                            .addComponent(jTextFieldC, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE)
                            .addComponent(jCheckBoxDadosEsparcos)
                            .addComponent(jCheckBoxDadosBinarios)
                            .addComponent(jCheckBoxKernalLinear))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelC))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldEps, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldTolerance, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldSigma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jCheckBoxDadosEsparcos)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jCheckBoxDadosBinarios)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jCheckBoxKernalLinear)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButtonConcluir)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonConcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonConcluirActionPerformed
        FacadeSVM.setC(             Double.parseDouble(jTextFieldC.getText()));
        FacadeSVM.setEps(           Double.parseDouble(jTextFieldEps.getText()));
        FacadeSVM.setTolerance(     Double.parseDouble(jTextFieldTolerance.getText()));
        FacadeSVM.setSigma(         Double.parseDouble(jTextFieldSigma.getText()));
        FacadeSVM.setIsBinary(      jCheckBoxDadosBinarios.isSelected());
        FacadeSVM.setIsEsparceData( jCheckBoxDadosEsparcos.isSelected());
        FacadeSVM.setIsLinearKernel(jCheckBoxDadosEsparcos.isSelected());
        FacadeSVM.getJDialogConfig().dispose();
    }//GEN-LAST:event_jButtonConcluirActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonConcluir;
    private javax.swing.JCheckBox jCheckBoxDadosBinarios;
    private javax.swing.JCheckBox jCheckBoxDadosEsparcos;
    private javax.swing.JCheckBox jCheckBoxKernalLinear;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabelC;
    private javax.swing.JTextField jTextFieldC;
    private javax.swing.JTextField jTextFieldEps;
    private javax.swing.JTextField jTextFieldSigma;
    private javax.swing.JTextField jTextFieldTolerance;
    // End of variables declaration//GEN-END:variables

}
